#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <iostream>
#include <string>

using namespace testing;
using namespace std;

TEST(StringFinderTest, should_find)
{
    std::string content("aeiou uoiea\n abcd");
    int n;
    if ((n = content.find("i")) != string::npos)
    {
        cout << "1) find n: " << n << " " << content.substr(n) <<endl;      
    }

    if ((n = content.find("i",3)) != string::npos)
    {
        cout << "2) find from index n: " << n << " " << content.substr(n) <<endl;      
    }
    
    if ((n = content.find("not exist",3)) == string::npos)
    {
        cout << "3) not exist n: " << n << " "  <<endl;      
    }
    // content.find

}

TEST(StringFinderTest, should_find_first_of)
{
    std::string str ("It replaces the vowels in this sentence by asterisks.");
    std::size_t found = str.find_first_of("aeiou");
    while (found!=std::string::npos) {
        str[found]='*';
        found=str.find_first_of("aeiou",found+1);
    }

    std::cout << str << '\n';
}